		<div id="content" class="span10">
			<!-- content starts -->
			

			<div>
				<ul class="breadcrumb">
					<li>
						<a href="<?php echo base_url('panel'); ?>">Inicio</a> <span class="divider">/</span>
					</li>
					<li>Ventas</li>
				</ul>
			</div>

			<div class="row-fluid">		
				<div class="box span12">
					<div class="box-header well" data-original-title>
						<h2><i class="icon-shopping-cart"></i> Ventas</h2>
						<div class="box-icon">
							<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
							<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
						</div>
					</div>
					<div class="box-content">
						<form action="<?php echo base_url('panel/ventas/'); ?>" method="get" class="form-search">
							<div class="form-actions center">
								<label for="ffolio">Folio</label> 
								<input type="text" name="ffolio" id="ffolio" value="<?php echo set_value_get('ffolio'); ?>" class="input-medium search-query" autofocus> |

								<label for="fnombre">Nombre</label> 
								<input type="text" name="fnombre" id="fnombre" value="<?php echo set_value_get('fnombre'); ?>" class="input-medium search-query"> |
								
								<label for="ffecha_ini">Del</label> 
								<input type="text" name="ffecha_ini" id="ffecha_ini" value="<?php echo set_value_get('ffecha_ini'); ?>" class="input-small datepicker">
								
								<label for="ffecha_fin">Al</label> 
								<input type="text" name="ffecha_fin" id="ffecha_fin" value="<?php echo set_value_get('ffecha_fin'); ?>" class="input-small datepicker">
								
								<br>
								<label for="ftipo" style="margin-top: 10px;">Tipo:</label> 
								<select name="ftipo" id="ftipo">
									<option value="todos" <?php echo set_select_get('ftipo', 'todos'); ?>>TODOS</option>
									<option value="todo" <?php echo set_select_get('ftipo', 'todo'); ?>>ILIMITADO</option>
									<option value="segmento" <?php echo set_select_get('ftipo', 'segmento'); ?>>INDIVIDUAL</option>
								</select>
								
								<label for="fstatus">Estatus</label>
								<select name="fstatus">
									<option value="todos" <?php echo set_select('fstatus', 'todos', false, $this->input->get('fstatus')); ?>>TODOS</option>
									<option value="1" <?php echo set_select('fstatus', '1', false, $this->input->get('fstatus')); ?>>ACTIVOS</option>
									<option value="0" <?php echo set_select('fstatus', '0', false, $this->input->get('fstatus')); ?>>PENDIENTES</option>
								</select>
								
								<input type="submit" name="enviar" value="Enviar" class="btn">
							</div>
						</form>

						<a href="<?php echo base_url('panel/articulos/agregar'); ?>" class="btn btn-success pull-right" style="margin-bottom: 10px;">
								<i class="icon-white icon-plus "></i>
							Agregar
						</a>
						<table class="table table-striped table-bordered bootstrap-datatable">
						  <thead>
							  <tr>
								  <th>Folio</th>
								  <th>Cliente</th>
								  <th>F. creacion</th>
								  <th>F. vencimiento</th>
								  <th>Tipo</th>
								  <th>F. Pago</th>
								  <th>Costo</th>
								  <th>Estado</th>
								  <th>Opciones</th>
							  </tr>
						  </thead>   
						  <tbody>
						<?php 
						$total_paq = 0;
						foreach($ventas['ventas'] as $venta){ 
							$total_paq += $venta->costo;
						?>
							<tr>
								<td class="tcenter"><?php echo $venta->folio; ?></td>
								<td><?php echo $venta->nombre; ?></td>
								<td><?php echo $venta->fecha_creacion; ?></td>
								<td class="tcenter"><?php echo $venta->fecha_vencimiento; ?></td>
								<td class="tcenter"><?php echo $venta->tipo; ?></td>
								<td class="tcenter"><?php echo $venta->forma_pago; ?></td>
								<td class="tcenter"><?php echo String::formatoNumero($venta->costo); ?></td>
								<td>
									<?php 
										if($venta->status == 1){
											$v_status = 'Activo';
											$vlbl_status = 'label-success';
										}else{
											$v_status = 'Pendiente';
											$vlbl_status = 'label-warning';
										}
									?>
									<span class="label <?php echo $vlbl_status; ?>"><?php echo $v_status; ?></span>
								</td>
								<td class="tcenter">
									<a class="btn btn-info" href="<?php echo base_url('panel/paquetes/resumen/?id='.$venta->id_usuario); ?>">
										<i class="icon-edit icon-white"></i>
										Resumen
									</a>
									<?php if ($venta->status == 1) {?>
										<a class="btn btn-danger" href="<?php echo base_url('panel/paquetes/eliminar/?id='.$venta->folio); ?>" onclick="msb.confirm('Estas seguro de eliminar la venta?', 'Publicaciones', this); return false;">
											<i class="icon-trash icon-white"></i>
											Eliminar</a>
									<?php } else {?>
										<a class="btn btn-success" href="<?php echo base_url('panel/paquetes/activar/?id='.$venta->folio); ?>" onclick="msb.confirm('Estas seguro de activar la venta?', 'Publicaciones', this); return false;">
											<i class="icon-zoom-in icon-white"></i>
											Activar</a>
									<?php } ?>
								</td>
							</tr>
					<?php }?>
						  </tbody>
						  <tfoot>
						  	<tr style="font-weight: bold">
						  		<td colspan="5" class="tright">Total x pag.</td>
						  		<td colspan="2" class="tright"><?php echo String::formatoNumero($total_paq); ?></td>
						  	</tr>
						  	<tr style="font-weight: bold">
						  		<td colspan="5" class="tright">Total</td>
						  		<td colspan="2" class="tright"><?php echo String::formatoNumero($ventas['total_ventas']); ?></td>
						  	</tr>
						  </tfoot>
					  </table>

					  <?php
						//Paginacion
						$this->pagination->initialize(array(
								'base_url' 			=> base_url($this->uri->uri_string()).'?'.String::getVarsLink(array('pag')).'&',
								'total_rows'		=> $ventas['total_rows'],
								'per_page'			=> $ventas['items_per_page'],
								'cur_page'			=> $ventas['result_page']*$ventas['items_per_page'],
								'page_query_string'	=> TRUE,
								'num_links'			=> 1,
								'anchor_class'	=> 'pags corner-all',
								'num_tag_open' 	=> '<li>',
								'num_tag_close' => '</li>',
								'cur_tag_open'	=> '<li class="active"><a href="#">',
								'cur_tag_close' => '</a></li>'
						));
						$pagination = $this->pagination->create_links();
						echo '<div class="pagination pagination-centered"><ul>'.$pagination.'</ul></div>'; 
						?>
					</div>
				</div><!--/span-->
			
			</div><!--/row-->
				  

					<!-- content ends -->
		</div><!--/#content.span10-->


<!-- Bloque de alertas -->
<?php if(isset($frm_errors)){
	if($frm_errors['msg'] != ''){ 
?>
<script type="text/javascript" charset="UTF-8">
	$(document).ready(function(){
		noty({"text":"<?php echo $frm_errors['msg']; ?>", "layout":"topRight", "type":"<?php echo $frm_errors['ico']; ?>"});
	});
</script>
<?php }
}?>
<!-- Bloque de alertas -->
